package com.wp.backup.service.impl;

import com.wp.backup.service.MySqlBackupService;
import com.wp.backup.util.MySqlBackupRestoreUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wp
 * @create 2019-03-06 11:52
 */
@Service
public class MySqlBackupServiceImpl implements MySqlBackupService {
    @Override
    public boolean backup(String host, String userName, String password, String backupFolderPath, String fileName, List<String> databases) throws Exception {
        return MySqlBackupRestoreUtils.backup(host, userName, password, backupFolderPath, fileName, databases);
    }

    @Override
    public boolean restore(String restoreFilePath, String host, String userName, String password, List<String> databases) throws Exception {
        return MySqlBackupRestoreUtils.restore(restoreFilePath, host, userName, password, databases);
    }
}
